#include <iostream>
#include <deque>
using namespace std;

int main(int argc, char const *argv[])
{
    deque<string> queue(3);
     queue[0] = "abc";
     queue[1] = "efg";
     queue[2] = "hig";

     for (int i = 0; i< 3; i++) {
        cout << queue[i] << endl;
     }
    cout << "-------" <<endl;

    queue.push_front("123");

    queue.push_back("456");

    for (int i = 0 ;i< queue.size(); i++) {
        cout << queue[i] <<endl;
    }

    cout << "-------" <<endl;
    // 迭代器
    deque<string> :: iterator it;
    for (it = queue.begin(); it != queue.end(); it++) {
        cout << *it <<endl;
    }
    // 可以从后端删除， 也可以从前端删除
    while (!queue.empty()) {
        cout << queue.back() <<endl;
        queue.pop_back();
    }


    return 0;
}
